package com.mz.mattress.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mz.mattress.api.entity.Investor;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface InvestorMapper extends BaseMapper<Investor> {

    Page<Investor> listPage(Page page,
                        @Param("name") String name,
                        @Param("status") Integer status,
                        @Param("startTime") String startTime,
                        @Param("endTime") String endTime);

    @Select("select * from mz_investor where mobile=#{mobile} and deleted=0 limit 1")
    Investor selectByMobile(@Param("mobile") String mobile);

    @Select("select id,mobile,name from mz_investor where mobile like concat('%', #{mobile}, '%') and status=0 and deleted=0 limit 5")
    List<Investor> searchByMobile(@Param("mobile") String mobile);

    @Select("select id,name from mz_investor where deleted=0 and status=0")
    List<Investor> list();

}
